<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/bootstrap.css" type="text/css" rel="stylesheet">

<title>美味书签</title>
</head>

<body>
	<%@include file="header.jsp"%>
	<!-- 主体部分 -->
	<div class="container">
		<div class="row">
			<!-- 主页的左半面 -->
			<div id="mainbar" class="span10">
				<input id="tabType" type="hidden"
					value=<s:property value="tabType" />>
				<ul class="nav nav-tabs">
					<li id="listTab"><a
						href="listhome?userId=<s:property value="userId" />">list</a></li>
					<li id="feedTab"><a
						href="feedhome?userId=<s:property value="userId" />">feed</a></li>
				</ul>

				<div class="tab-content">
					<div class="link tab-pane active">
						<s:iterator value="bmlist">
							<div class="row">
								<div class="feedUser span0">
									<img width="50" height="50" alt="profile pic"
										src="upload/<s:property value="avatar"/>">
								</div>
								<div class="body span8">
									<div class="feedUser">
										<a href="listhome?userId=<s:property value="user_id"/>"><s:property
												value="username" /></a><small>保存了该链接</small>
									</div>
									<a title=<s:property value="title"/> target="_blank"
										href="http://<s:property value="url"/>"><s:property
											value="title" /></a>

									<div class="sub">
										<a class="saves"
											href="match?searchUrl=<s:property
												value="url" />"><s:property
												value="saveNum" /> save</a> <span><s:property
												value="url" /></span>
									</div>

									<blockquote>
										<small><s:property value="description" /> </small>
									</blockquote>
								</div>
								<div class="action pull-right">
									<s:if test="#session.sessionUser != null">
										<s:if test="#session.sessionUser.id == user_id">
										<div>
											<button class="editLink btn" value=<s:property value="id"/>>编辑</button>
										</div>
										</s:if>
										<s:else>
											<button class="editLink btn" value=<s:property value="id"/>>添加</button>
										</s:else>
									</s:if>
									<s:else>
										<div>
											<a class="editLink btn" href="register.jsp">添加</a>
										</div>
									</s:else>
									<div id="ckepop">
										<a target="_blank" class="btn jiathis"
											href="http://www.jiathis.com/share" style="">分享</a>
									</div>
								</div>
							</div>
							<div class="row">
								<div class="taglist span8">
									<s:iterator value="linkTags" id="tagName">
										<button class="btn linkTag"
											value="<s:property value="tagName" />">
											<s:property value="tagName" />
										</button>
									</s:iterator>
								</div>
							</div>
							<hr>
						</s:iterator>
						<s:if test="pageBean.pagingFlag">
							<div class="pagination pagination-centered">
								<input id="currentPage" type="hidden"
									value=<s:property value="pageBean.current"/>>
								<ul>
									<s:if test="1 not in pageBean.pages">
										<li><a href="#">1</a></li>
										<li><a class="disabled" href="#">...</a></li>
									</s:if>

									<s:iterator value="pageBean.pages" id="pageIndirect">
										<li><a class="pageUrl"
											href="?userId=<s:property value='userId'/>&pageBean.current=<s:property value="pageIndirect" />"><s:property
													value="pageIndirect" /></a></li>
									</s:iterator>
									<s:if test="feedPageBean.pageSize not in feedPageBean.pages">
										<li><a class="disabled" href="#">...</a></li>
										<li><a href="#"> <s:property
													value="pageBean.pageSize" />
										</a></li>
									</s:if>
								</ul>
							</div>
						</s:if>
					</div>
				</div>
			</div>

			<!-- 主页的右半部分 -->
			<div id="sidebar" class="span2">
				<div class="span2">
					<s:if test="#session.sessionUser == null">
						<button class="span2 btn btn-primary"
							onclick="window.open('register.jsp');">关注</button>
					</s:if>
					<s:elseif test="#session.sessionUser.id != user.id">
						<button class="span2 btn btn-primary followBtn"
							fid=<s:property value="userId" />
							action=<s:property value="followAction"/> data-loading-text="关注中"
							data-complete-text="取消关注">关注</button>
					</s:elseif>

					<div class="span2">
						<img width="150" height="150" alt="profile pic"
							src="upload/<s:property value="user.avatar"/>">
						<h3>
							<s:property value="user.username" />
						</h3>
						<ul class="unstyled">
							<li>关注 <a href="followingList"><s:property
										value="user.followingNum" /></a></li>
							<li>粉丝 <a href="followerList"><s:property
										value="user.followNum" /></a></li>
						</ul>
						<hr />
						<ul>
							<li><a href="listhome?userId=<s:property value='userId'/>"><s:property
										value="user.bookmarkNum" />条收藏</a></li>
						</ul>
						<hr />
					</div>
				</div>
			</div>
		</div>
	</div>
	<script src="js/jquery-1.7.2.js"></script>
	<script src="js/bootstrap.js"></script>
	<script src="js/jquery.tagsinput.js"></script>
	<script type="text/javascript"
		src="http://v3.jiathis.com/code_mini/jia.js" charset="utf-8"></script>
	<script src="js/application.js"></script>
</body>
</html>